<nav class="navbar navbar-default navbar-static-top" role="navigation">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="/">Tweet Speech</a>
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      {% if current_user.is_authenticated %}
        <ul class="nav navbar-nav navbar-right">
          <li class="dropdown">
            <a
              href="#"
              class="dropdown-toggle"
              data-toggle="dropdown"
              aria-haspopup="true"
              aria-expanded="false"
            >
              @{{current_user.username}}
              <span class="caret"/>
            </a>
            <ul class="dropdown-menu">
              <li>
                <img
                  alt="profile pic"
                  src="{{current_user.get_image_url()}}"
                  align="center"
                />
              </li>
              <li>
                <a href="{{url_for('users.logout')}}">
                  Logout
                </a>
              </li>
            </ul>
          </li>
        </ul>
      {%else%}
        <ul class="nav navbar-nav navbar-right">
          <li>
            <a href="{{url_for('users.login')}}">
              <img
                src={{url_for('static',filename='images/sign-in-with-twitter-gray.png')}}
                alt='Sign in with Twitter'
              />
            </a>
          </li>
        </ul>
      {%endif%}
    </div>
  </div>
</nav>
